Skip to content

Conversation

@RensR
Copy link
Collaborator

@RensR RensR commented Jan 3, 2026

The previous helpers required abigen to be in a hard coded relative location. These changes allow us to call the gethwrapper logic directly with args for the abigen executable.

} else {
outDirSuffix = "latest"
}
outDirSuffix := "latest"
Copy link
Collaborator Author

@RensR RensR Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrappers are always generated into latest. Teams that wish to adopt this new wrapper generation should also adopt the versioned gethwrappers.

@RensR RensR marked this pull request as ready for review January 12, 2026 10:15
@RensR RensR requested a review from a team as a code owner January 12, 2026 10:15
Copilot AI review requested due to automatic review settings January 12, 2026 10:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the flexibility of gethwrapper helpers by removing the hardcoded relative location for the abigen executable. Instead, the changes allow passing the abigen executable path as an argument, making the wrapper generation more configurable.

Changes:

  • Removed GetProjectRoot() helper function that walked the filesystem to find the project root
  • Refactored wrapper generation logic into a reusable wrap package
  • Added AbiGenPath parameter to AbigenArgs struct to accept the abigen executable path as an argument

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
gethwrappers/helpers/utils.go Removed unused GetProjectRoot() function and filepath import
gethwrappers/helpers/generate/wrap/wrap.go New package containing extracted GenWrapper() and GetOutDir() functions
gethwrappers/helpers/generate/wrap.go Refactored to use new wrap package and accept abiGenPath as command-line argument
gethwrappers/helpers/abigen.go Updated to accept and use AbiGenPath parameter instead of computing path via GetProjectRoot()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// <project>/generated/<pkgName>/<pkgName>.go. The suffix will take place after
// the <project>/generated, so the overridden location would be
// <project>/generated/<outDirSuffixInput>/<pkgName>/<pkgName>.go.
func GenWrapper(projectRoot, contract, pkgName, outDirSuffixInput, abiGenPath string) {
Copy link
Contributor

@RayXpub RayXpub Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: is this function not used in this repo and only intended to be a helper for other repos? it looks to me like this repo only uses https://github.com/smartcontractkit/chainlink-evm/blob/modify-gethwrapper-helpers/gethwrappers/generation/generate/genwrapper/genwrapper.go?
nit: could we add a comment/example of what the projectRoot arg is?

@RensR RensR enabled auto-merge (squash) January 13, 2026 09:32
@RensR RensR merged commit e13e0dd into develop Jan 13, 2026
33 checks passed
@RensR RensR deleted the modify-gethwrapper-helpers branch January 13, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants